<template>
<div class="count">
    <h1>{{count}}</h1>
    <button @click="add">点击累加</button>
</div>
</template>

<script>
export default {
  name:'MyCount',
  data(){
    return {
      count:0
    }
  },
  methods:{
    add(){
      this.count++
    }
  }

}
</script>

<style scoped>
.count{
  height: 200px;
  background: red;
}
</style>